'\" te
.\"  Copyright 1989 AT&T
.\"  Copyright (c) 2006, Sun Microsystems, Inc.,
.\"  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PUTCTL1 9F "Jan 16, 2006"
.SH NAME
putctl1 \- send a control message with a one-byte parameter to a queue
.SH SYNOPSIS
.LP
.nf
#include <sys/stream.h>



\fBint\fR \fBputctl1\fR(\fBqueue_t *\fR\fIq\fR, \fBint\fR \fItype\fR, \fBint\fR \fIp\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Architecture independent level 1 (DDI/DKI).
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIq\fR\fR
.ad
.RS 8n
Queue to which the message is to be sent.
.RE

.sp
.ne 2
.na
\fB\fItype\fR\fR
.ad
.RS 8n
Type of message.
.RE

.sp
.ne 2
.na
\fB\fIp\fR\fR
.ad
.RS 8n
One-byte parameter.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBputctl1()\fR function, like \fBputctl\fR(9F), tests the \fItype\fR
argument to make sure a data type has not been specified, and attempts to
allocate a message block. The \fIp\fR parameter can be used, for example, to
specify how long the delay will be when an \fBM_DELAY\fR message is being sent.
\fBputctl1()\fR fails if \fItype\fR is \fBM_DATA\fR, \fBM_PROTO\fR, or
\fBM_PCPROTO\fR, or if a message block cannot be allocated. If successful,
\fBputctl1()\fR calls the \fBput\fR(9E) routine of the queue pointed to by
\fIq\fR with the newly allocated and initialized message.
.SH RETURN VALUES
.sp
.LP
On success, \fB1\fR is returned. \fB0\fR is returned if \fItype\fR is a data
type, or if a message block cannot be allocated.
.SH CONTEXT
.sp
.LP
The \fBputctl1()\fR function can be called from user, interrupt, or kernel
context.
.SH EXAMPLES
.sp
.LP
See the \fBputctl\fR(9F) function page for an example of \fBputctl1()\fR.
.SH SEE ALSO
.sp
.LP
.BR put (9E),
.BR allocb (9F),
.BR datamsg (9F),
.BR putctl (9F),
.BR putnextctl1 (9F)
.sp
.LP
\fIWriting Device Drivers\fR
.sp
.LP
\fISTREAMS Programming Guide\fR
